package cn.lf.android.lawfirm.utils;

import android.text.TextUtils;
import android.widget.TextView;

/**
 * 判断一切数据是否为空的工具类,可以后续添加
 * Created by YZL on 2017/6/19.
 */
public class EmptyUtil {
    /**
     * 是否为空
     * @param et
     * @return
     */
    public static boolean isEmpty(TextView tv){
        if(tv==null){
            throw new NullPointerException("TextView 不能为空");
        }
        CharSequence text = tv.getText();
        if(TextUtils.isEmpty(text)||TextUtils.isEmpty(text.toString().trim())){
            return true;
        }

        return false;
    }

    public static boolean isEmpty(CharSequence charSequence){
        if(TextUtils.isEmpty(charSequence)|| TextUtils.isEmpty(charSequence.toString().trim())){
            return true;
        }
        return false;
    }
}
